﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:vm="clr-namespace:iTFF.WPF.ViewModel"
    xmlns:vw="clr-namespace:iTFF.WPF.View">

  <!-- 
  All Windows font
  -->
  <Style x:Key="WindowStyle" TargetType="{x:Type Window}">
    <Setter Property="FontFamily" Value="Verdana" />
    <Setter Property="FontSize" Value="11" />
  </Style>

  <!--
  MVVM correspondance
  -->
  <DataTemplate DataType="{x:Type vm:GlobalHotKeysViewModel}">
    <vw:GlobalHotKeysView />
  </DataTemplate>

  <DataTemplate DataType="{x:Type vm:ArtworksViewModel}">
    <vw:ArtworksView />
  </DataTemplate>

  <DataTemplate DataType="{x:Type vm:PreferencesViewModel}">
    <vw:PreferencesView />
  </DataTemplate>

  <!--
  Styles for TabItem elements
  -->
  <Style TargetType="{x:Type Border}" x:Key="tabItemBorderStyle">
    <Setter Property="Margin" Value="5" />
    <Setter Property="CornerRadius" Value="5" />
    <Setter Property="BorderThickness" Value="1" />
    <Setter Property="BorderBrush" Value="Black" />
    <Setter Property="Background" Value="White" />
  </Style>

  <!--
  Header Content control
  -->
  <LinearGradientBrush x:Key="Brush_HeaderBackground" StartPoint="0.5,0" EndPoint="0.5,1">
    <GradientStop Color="#7EACD8" Offset="0" />
    <GradientStop Color="#678DB2" Offset="1" />
  </LinearGradientBrush>

  <Style x:Key="MainHCCStyle" TargetType="{x:Type HeaderedContentControl}">
    <Setter Property="HeaderTemplate">
      <Setter.Value>
        <DataTemplate>
          <Border 
            Background="{StaticResource Brush_HeaderBackground}" 
            BorderBrush="LightGray" 
            BorderThickness="1" 
            CornerRadius="5" 
            Margin="4" 
            Padding="4" 
            SnapsToDevicePixels="True" 
            >
            <TextBlock 
              FontSize="14"
              FontWeight="Bold"
              Foreground="White" 
              HorizontalAlignment="Center"  
              Text="{TemplateBinding Content}" 
              />
          </Border>
        </DataTemplate>
      </Setter.Value>
    </Setter>
    <Setter Property="IsTabStop" Value="False" />
    <Setter Property="Template">
      <Setter.Value>
        <!-- 
        This template ensures that content of a HeaderedContentControl 
        fills the available vertical space. 
        -->
        <ControlTemplate TargetType="{x:Type HeaderedContentControl}">
          <DockPanel>
            <ContentPresenter 
              DockPanel.Dock="Top"
              ContentSource="Header" 
              ContentTemplate="{TemplateBinding HeaderTemplate}" 
              />
            <ContentPresenter 
              ContentSource="Content" 
              ContentTemplate="{TemplateBinding ContentTemplate}" 
              />
          </DockPanel>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

</ResourceDictionary>